/**************************************************************************************** Import */
import React, {Component} from 'react';
import { SafeAreaView, createAppContainer, createStackNavigator, createSwitchNavigator } from 'react-navigation';

/**************************************************************************************** Screen */
import Pages from './pages';
import Powers from './powers';
import Layer from '../library/comp/system/layer';

/**************************************************************************************** Routing */
const Switcher = createSwitchNavigator(
	{
		Pages,
		Powers
	},
	{
		initialRouteName: 'Pages',
	}
);
const Routing = createAppContainer(Switcher);

/**************************************************************************************** RootView */
/**
 * 注意：在此处挂载全局layer
 */
export default class RootView extends Component {
	render() {
		return (
			<SafeAreaView style={{flex: 1, flexDirection: 'column'}}>
				<Routing></Routing>
				<Layer ref={(ref)=> {global.refLayer = ref;}}></Layer>
			</SafeAreaView>
		);
	}
}
